/**
 * 
 */
package com.hand.cloud.b2b.daos.impl;

import de.hybris.platform.core.model.user.AddressModel;
import de.hybris.platform.servicelayer.ServicelayerTransactionalTest;

import javax.annotation.Resource;

import junit.framework.Assert;

import org.junit.Test;

import com.hand.cloud.b2b.daos.AddressDAO;
import com.hand.cloud.b2b.model.EPAddressModel;


/**
 * @author StephenWang
 * @time Jul 28, 2014 3:28:52 PM
 * 
 */
public class DefaultAddressDAOTest extends ServicelayerTransactionalTest
{

	@Resource
	private AddressDAO addressDAO;

	@Test
	public void test()
	{
		
		Assert.assertEquals("China", addressDAO.getCountry("CN").getName());

		EPAddressModel address = new EPAddressModel();
		/*address.setReceiver_address("上海浦东");
		address.setReceiver_city("上海市");
		address.setReceiver_district("浦东新区");
		address.setReceiver_mobile("1234567");
		address.setReceiver_name("孤独的飞鸟");
		address.setReceiver_state("上海");
		address.setReceiver_zip("210210");*/
		
		address.setReceiverAddress("上海浦东");
		address.setReceiverCity("上海市");
		address.setReceiverDistrict("浦东新区");
		address.setReceiverMobile("1234567");
		address.setReceiverName("孤独的飞鸟");
		address.setReceiverState("上海");
		address.setReceiverZip("210210");

		AddressModel addressModel = addressDAO.createAddress(address);
		
		System.out.println(addressModel.getPk());
	}

}
